<!DOCTYPE html>
<html lang="zh_CN" style="overflow: hidden;">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta charset="utf-8">
    <title>{$site_info.site_name|default=''} {:lang('ADMIN_CENTER')}</title>
    <meta name="description" content="This is page-header (.page-header &gt; h1)">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->
    <link href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/bootstrap.min.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css?page=index" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="__TMPL__/public/assets/themes/{:cmf_get_admin_style()}/simplebootadminindex.min.css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        /*-----------------导航hack--------------------*/
        .nav-list > li.open {
            position: relative;
        }

        .nav-list > li.open .back {
            display: none;
        }

        .nav-list > li.open .normal {
            display: inline-block !important;
        }

        .nav-list > li.open a {
            padding-left: 7px;
        }

        .nav-list > li .submenu > li > a {
            background: #fff;
        }

        .nav-list > li .submenu > li a > [class*="fa-"]:first-child {
            left: 20px;
        }

        .nav-list > li ul.submenu ul.submenu > li a > [class*="fa-"]:first-child {
            left: 30px;
        }
		/*新增样式*/
		.cmf-component-tabitem{background: #ecf0f1; margin-right:1px;}
		@media (min-width: 768px){
			.navbar-nav>li>a {
				padding-top: 10px;
				padding-bottom: 10px;
			}
		}
		#sidebar-shortcuts {
			height: 42px;
			max-height:45px;
		}
		.red-pointer{width: 18px;
			height: 18px;
			border-radius: 50%;
			background: red;
			float:right;
			color: #fff;
			text-align: center;
			margin-left: -12px;}
        /*----------------导航hack--------------------*/
    </style>

    <script>
        //全局变量
        var RCABase={},GV = {
            HOST: "{$_SERVER['HTTP_HOST']|default=''}",
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            ver:'{:time()}', STATIC_JS :  "/static/js/"
        };
    </script>
    <php>$submenus=$menus;</php>

    <php>
        if (!function_exists('getsubmenu')) {
            function getsubmenu($submenus){

    </php>
    <notempty name="submenus">
        <php>foreach($submenus as $menu){</php>
        <li>
            <php>
                $menu_name=lang($menu['lang']);
                $menu_name=$menu['lang']==$menu_name?$menu['name']:$menu_name;
            </php>
            <php>if(empty($menu['items'])){</php>
            <a href="javascript:openapp('{$menu.url}','{$menu.id}','{$menu_name}',true);">
                <!--<i class="fa fa-{$menu.icon|default='desktop'}"></i>-->
                <i class="fa fa-caret-right"></i>
                <span class="menu-text"> {$menu_name} </span>
            </a>
            <php>}else{</php>
            <a href="#" class="dropdown-toggle">
                <!--<i class="fa fa-{$menu.icon|default='desktop'} normal"></i>-->
                <i class="fa fa-caret-right normal"></i>
                <span class="menu-text normal"> {$menu_name} </span>
                <b class="arrow fa fa-angle-right normal"></b>
                <i class="fa fa-reply back"></i>
                <span class="menu-text back">返回</span>

            </a>

            <ul class="submenu">
                <php>getsubmenu1($menu['items'])</php>
            </ul>
            <php>}</php>

        </li>

        <php>}</php>
    </notempty>
    <php>
            }
        }
    </php>

    <php>
        if (!function_exists('getsubmenu1')) {
            function getsubmenu1($submenus){
    </php>
    <php>foreach($submenus as $menu){</php>
    <li>
        <php>
            $menu_name=lang($menu['lang']);
            $menu_name=$menu['lang']==$menu_name?$menu['name']:$menu_name;
        </php>
        <php>if(empty($menu['items'])){</php>
        <a href="javascript:openapp('{$menu.url}','{$menu.id}','{$menu_name}',true);">
            <i class="fa fa-caret-right"></i>
            <span class="menu-text">
									{$menu_name}
								</span>
        </a>
        <php>}else{</php>
        <a href="#" class="dropdown-toggle">
            <i class="fa fa-caret-right"></i>
            <span class="menu-text">
									{$menu_name}
								</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <ul class="submenu">
            <php>getsubmenu2($menu['items'])</php>
        </ul>
        <php>}</php>

    </li>

    <php>}</php>
    <php>}
    }
    </php>

    <php>
        if (!function_exists('getsubmenu2')) {
            function getsubmenu2($submenus){</php>
    <php>foreach($submenus as $menu){</php>
    <li>
        <php>
            $menu_name=lang($menu['lang']);
            $menu_name=$menu['lang']==$menu_name?$menu['name']:$menu_name;
        </php>

        <a href="javascript:openapp('{$menu.url}','{$menu.id}','{$menu_name}',true);">
            &nbsp;<i class="fa fa-angle-double-right"></i>
            <span class="menu-text">
								{$menu_name}
							</span>
        </a>
    </li>

    <php>}</php>
    <php>}
    }
    </php>


    <if condition="APP_DEBUG">
        <style>
            #think_page_trace_open {
                left: 0 !important;
                right: initial !important;
            }
        </style>
    </if>

</head>

<body style="min-width:900px;overflow: hidden;">
<div id="loading"><i class="loadingicon"></i><span>{:lang('LOADING')}</span></div>
<div id="right-tools-wrapper">
    <!--<span id="right_tools_clearcache" title="清除缓存" onclick="javascript:openapp('{:url('admin/Setting/clearcache')}','right_tool_clearcache','清除缓存');"><i class="fa fa-trash-o right_tool_icon"></i></span>-->
    <!--<span id="refresh-wrapper" title="{:lang('REFRESH_CURRENT_PAGE')}"><i-->
            <!--class="fa fa-refresh right_tool_icon"></i></span>-->
</div>
<div class="navbar navbar-default" style="height:68px;">
    <div class="container-fluid" style=" margin-top:12px;">
    	<!--网站名称-->
        <div class="navbar-header">
            <a href="{:url('admin/index/index')}" class="navbar-brand" style="min-width: 200px;text-align: center;">{$site_info.site_name|default=''}</a>
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <!--一级菜单-->
        <div style="float:left; margin-top:-12px;">
        <php>foreach($submenus as $menu){ </php>

            <div style="margin-top: 18px; margin-left: 20px;float:left">
               <a href="#" id="{$menu.id}" onClick="getSecondMenu('{$menu.id}')" style="text-decoration:none;">

               <img class="nav-user-photo" width="28" height="28" src="{:cmf_get_image_preview_url($menu.cover_path)}" alt="{$admin.user_login}"><font color="#FFFFFF">&nbsp;{$menu.name}</font>
               </a>
            </div>

        <php>}</php>

        <div style="margin: 8px 0 0px 20px;float:left;">
            <div style="float:left;line-height:8px;background-color:#fff;padding:8px 15px 0px 15px">
                <p style="color:#0b7ebf" class="week_text"></p><br>
                <p style="color:#0b7ebf"><span style="font-size:2rem;margin-right:5px;" class="day_text"></span><span class="month_text"></span>月</p>
            </div>
            <div style="float:left;margin-left:10px;line-height:50px"><p style="color:#fff;font-size:3rem !important;" class="datetimestr"></p></div>
        </div>
        <div style="margin: 15px 0 5px 50px;float:left; cursor:pointer" onClick="javascript:openapp('{:url('Office/noticelist')}','100Admin','通知管理',true);">
            <img src="__TMPL__/public/assets/images/nread.png"/>
            <div class="red-pointer">{$noread}</div>
        </div>
        </div>
		<!---网站登录人-->
        <div class="navbar-collapse collapse" id="navbar-main">


            <ul class="nav navbar-nav navbar-right simplewind-nav">
                <li class="light-blue" style="border-left:none;display: none;" id="close-all-tabs-btn">
                    <a id="close-wrapper" href="javascript:void(0);" title="{:lang('CLOSE_TOP_MENU')}" style="color:#fff;font-size: 16px">
                        <i class="fa fa-times right_tool_icon"></i>
                    </a>
                </li>
                <li class="light-blue" style="border-left:none;">
                    <a id="refresh-wrapper" href="javacript:void(0);" title="{:lang('REFRESH_CURRENT_PAGE')}" style="color:#fff;font-size: 16px">
                        <i class="fa fa-refresh right_tool_icon"></i>
                    </a>
                </li>
                <li class="light-blue dropdown" style="border-left:none;">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <if condition="isset($admin['avatar']) && $admin['avatar']">
                            <img class="nav-user-photo" width="30" height="30"
                                 src="{:cmf_get_user_avatar_url($admin['avatar'])}" alt="{$admin.user_login}">
                            <else/>
                            <img class="nav-user-photo" width="30" height="30"
                                 src="__TMPL__/public/assets/images/logo-18.png" alt="{$admin.user_login|default=''}">
                        </if>
                        <span class="user-info">
								{:lang('WELCOME_USER',array('user_nickname' => empty($admin['user_nickname'] )? $admin['user_login'] : $admin['user_nickname']))}
							</span>
                        <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-closer">
<!--                        <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Setting/site')">-->
<!--                            <li>-->
<!--                                <a href="javascript:openapp('{:url('setting/site')}','index_site','{:lang('ADMIN_SETTING_SITE')}');"><i-->
<!--                                        class="fa fa-cog"></i> {:lang('ADMIN_SETTING_SITE')}</a></li>-->
<!--                        </if>-->
<!--                        <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/user/userinfo')">-->
<!--                            <li>-->
<!--                                <a href="javascript:openapp('{:url('user/userinfo')}','index_userinfo','{:lang('ADMIN_USER_USERINFO')}');"><i-->
<!--                                        class="fa fa-user"></i> {:lang('ADMIN_USER_USERINFO')}</a></li>-->
<!--                        </if>-->
                        <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Setting/password')">
                            <li>
                                <a href="javascript:openapp('{:url('setting/password')}','index_password','{:lang('ADMIN_SETTING_PASSWORD')}');"><i
                                        class="fa fa-lock"></i> {:lang('ADMIN_SETTING_PASSWORD')}</a></li>
                        </if>
                        <li><a href="{:url('Public/logout')}"><i class="fa fa-sign-out"></i> {:lang('LOGOUT')}</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</div>


<div class="main-container container-fluid">

    <div class="sidebar" id="sidebar">
        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <a class="btn btn-sm btn-warning" href="__ROOT__/"
               title="{:lang('WEBSITE_HOME_PAGE')}"
               target="_blank"
               data-toggle="tooltip">
                <i class="fa fa-home"></i>
            </a>
            <!--
            <if condition="cmf_auth_check(cmf_get_current_admin_id(),'portal/AdminCategory/index')">
                <a class="btn btn-sm btn-success" href="javascript:openapp('{:url('portal/AdminCategory/index')}','index_termlist','文章分类管理');" title="文章分类管理">
                    <i class="fa fa-th"></i>
                </a>
            </if>

            <if condition="cmf_auth_check(cmf_get_current_admin_id(),'portal/AdminArticle/index')">
                <a class="btn btn-sm btn-info" href="javascript:openapp('{:url('portal/AdminArticle/index')}','index_postlist','文章管理');" title="文章管理">
                    <i class="fa fa-pencil"></i>
                </a>
            </if>
            -->

            <if condition="cmf_auth_check(cmf_get_current_admin_id(),'user/AdminAsset/index')">
                <a class="btn btn-sm btn-info"
                   href="javascript:openapp('{:url('user/AdminAsset/index')}','userAdminAssetindex','资源管理',true);"
                   title="资源管理"
                   data-toggle="tooltip">
                    <i class="fa fa-file"></i>
                </a>
            </if>

            <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Setting/clearcache')">
                <a class="btn btn-sm btn-danger"
                   href="javascript:openapp('{:url('admin/Setting/clearcache')}','index_clearcache','{:lang('ADMIN_SETTING_CLEARCACHE')}',true);"
                   title="{:lang('ADMIN_SETTING_CLEARCACHE')}"
                   data-toggle="tooltip">
                    <i class="fa fa-trash-o"></i>
                </a>
            </if>

            <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/RecycleBin/index')">
                <a class="btn btn-sm btn-danger"
                   href="javascript:openapp('{:url('admin/RecycleBin/index')}','index_recycle','回收站',true);"
                   title="回收站"
                   data-toggle="tooltip">
                    <i class="fa fa-recycle"></i>
                </a>
            </if>

            <if condition="cmf_auth_check(cmf_get_current_admin_id(),'admin/Menu/index')">
                <a class="btn btn-sm btn-default"
                   href="javascript:openapp('{:url('admin/Menu/index')}','index_menu','{:lang('ADMIN_MENU_INDEX')}',true);"
                   title="{:lang('ADMIN_MENU_INDEX')}"
                   data-toggle="tooltip">
                    <i class="fa fa-list"></i>
                </a>
            </if>

        </div>
        <div id="nav-wrapper">
            <ul class="nav nav-list" id="secondMenuId">
                {:getsubmenu($initMenu)}
            </ul>
        </div>

    </div>
	<!--菜单栏-->
    <div class="pull-left" style="position: relative; margin-left:200px;border-bottom:1px solid #E5e5e5; width:100%;">
        <a id="task-pre" class="task-changebt"><i class="fa fa-chevron-left"></i></a>
        <div id="task-content">
            <ul class="nav navbar-nav cmf-component-tab" id="task-content-inner">
                <li class="cmf-component-tabitem noclose" app-id="0" app-url="{:url('main/index')}"
                    app-name="首页" style="margin-right:-3px;">
                    <a class="cmf-tabs-item-text">{:lang('HOME')}</a>
                </li>
            </ul>
            <div style="clear:both;"></div>
        </div>
        <a id="task-next" class="task-changebt"><i class="fa fa-chevron-right"></i></a>
    </div>
    <!--显示栏-->
    <div class="main-content">
        <div class="page-content" id="content">
            <iframe src="{:url('Main/index')}" style="width:100%;height: 100%; " frameborder="0" id="appiframe-0"
                    class="appiframe"></iframe>
        </div>
    </div>
</div>

<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/wind.js"></script>
<script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
<script src="__STATIC__/js/admin.js?v={:time()}"></script>
<script src="__TMPL__/public/assets/simpleboot3/js/adminindex.js?1"></script>
<iframe id="printf" src="" width="0" height="0" frameborder="0"></iframe>
<script type="text/javascript">
	// 拼接AJAX请求
	function getSecondMenu(id){
		// 拼接AJAX请求
		$.ajax({
			url		: "{:url('Index/getSecondMenuByAjax')}",
			type	: "post",
			dataType: "json",
			data	: {'id':id, 'Ajax': 1},
			success : function(result){
				if(result.code==0){
					alert(result.msg);
					return;
				}
				htmls = "";
				$.each(result, function(i, n){
					if(n.items != null){
						htmls += "<li><a href='#' class='dropdown-toggle'>"+
								  "<i class='fa fa-caret-right'></i>"+
									"<span class='menu-text'>"+n.name+
								"</span> <b class='arrow fa fa-angle-right'></b></a>"+
							"<ul  class='submenu'>";
						$.each(n.items, function(index, ite){
							if(ite.items !=null){
								htmls+= '<li><a href="#" class="dropdown-toggle">'+
									'<i class="fa fa-caret-right"></i>'+
									'<span class="menu-text">'+
										ite.name+
									'</span>'+
									'<b class="arrow fa fa-angle-right"></b>'+
								'</a>'+
								'<ul  class="submenu">';
								$.each(ite.items,function(lastindex,val){
									htmls+='<li>'+
										"<a href='javascript:openapp(\""+val.url+"\",\""+val.id+"\",\""+val.name+"\",true);'>"+
											'&nbsp;<i class="fa fa-angle-double-right"></i>'+
											'<span class="menu-text">'
												+val.name+
											'</span>'+
										'</a>'+
									'</li>';
								})
								htmls+='</ul></li>';
							}else{
								htmls+="<li>"+
									"<a href='javascript:openapp(\""+ite.url+"\",\""+ite.id+"\",\""+ite.name+"\",true);'>"+
									"&nbsp;<i class='fa fa-angle-double-right'></i>"+
									"<span class='menu-text'>"+ite.name+"</span></a></li>";
							}

						})
						htmls+="</ul></li>";
					}else{
						htmls += "<li>"+
						"<a href='javascript:openapp(\""+n.url+"\",\""+n.id+"\",\""+n.name+"\",true);'>"+
								"<i class='fa fa-caret-right'></i>"+
								"<span class='menu-text'>"+ n.name+"</span></a></li>";
					}
				});
				$("#secondMenuId").html(htmls);
			},
			error	: function(){
				alert("服务器内部错误，请联系系统管理员");
			}
		});}
</script>
<script>
    $(function () {
        $("[data-toggle='tooltip']").tooltip();
        $("li.dropdown").hover(function () {
            $(this).addClass("open");
        }, function () {
            $(this).removeClass("open");
        });

        var menus= {:$menus_js_var};
        //读取url参数。尝试执行菜单功能。
        if(typeof(menus) != "undefined"){

            var tw = window.top;
            var twa =tw.location.href.split("#");
            var url = twa[1];
            var urlTmp = url;
            if (url !=null ){
                //去掉/ 去掉_ 全部小写。
                urlTmp = urlTmp.replace(/[\\/|_|]/g,"");
                urlTmp = urlTmp.replace(".html","");
                var menu = menus[urlTmp];
                if (menu){
                    openapp(url,menu.id+menu.app,menu.name,true);
                }
            }
        }




    });

    var ismenumin = $("#sidebar").hasClass("menu-min");
    $(".nav-list").on("click", function (event) {
        var closest_a = $(event.target).closest("a");
        if (!closest_a || closest_a.length == 0) {
            return
        }
        if (!closest_a.hasClass("dropdown-toggle")) {
            if (ismenumin && "click" == "tap" && closest_a.get(0).parentNode.parentNode == this) {
                var closest_a_menu_text = closest_a.find(".menu-text").get(0);
                if (event.target != closest_a_menu_text && !$.contains(closest_a_menu_text, event.target)) {
                    return false
                }
            }
            return
        }
        var closest_a_next = closest_a.next().get(0);
        if (!$(closest_a_next).is(":visible")) {
            var closest_ul = $(closest_a_next.parentNode).closest("ul");
            if (ismenumin && closest_ul.hasClass("nav-list")) {
                return
            }
            closest_ul.find("> .open > .submenu").each(function () {
                if (this != closest_a_next && !$(this.parentNode).hasClass("active")) {
                    $(this).slideUp(150).parent().removeClass("open")
                }
            });
        }
        if (ismenumin && $(closest_a_next.parentNode.parentNode).hasClass("nav-list")) {
            return false;
        }
        $(closest_a_next).slideToggle(150).parent().toggleClass("open");
        return false;
    });

	//页面加载成功后运行
		$(document).ready(function(e) {
			setInterval("clock()",1000);
		});
		window.οnlοad=function(){
			//1s加载一次
			//setInterval("clock()",1000);
		}

	function clock () {
			//全局变量d，创建Date对象
			var data = new Date();
			//alert(data.getDate()+1);
			$('.month_text').text(data.getMonth()+1 );
			$('.day_text').text(data.getDate());
			var week;
	　　　　//switch判断
	　　　　switch (data.getDay()){
	　　　　　　case 1: week="星期一"; break;
	　　　　　　case 2: week="星期二"; break;
	　　　　　　case 3: week="星期三"; break;
	　　　　　　case 4: week="星期四"; break;
	　　　　　　case 5: week="星期五"; break;
	　　　　　　case 6: week="星期六"; break;
	　　　　　　default:week="星期天"; break;
	　　　　}
		 var hours=data.getHours();
	　　　　//判断小于10，前面补0
	　　　　if(hours<10){
	　　　　　　hours="0"+hours;
	　　　　}
	　　　　//分
	　　　　var minutes =data.getMinutes();
	　　　　//判断小于10，前面补0
	　　　　if(minutes<10){
	　　　　　　minutes="0"+minutes;
	　　　　}
　　　	　var date_str = hours+":"+minutes;
	      $('.datetimestr').text(date_str);
		  $('.week_text').text(week);
		}

</script>
</body>
</html>
